package top.luhancc.mztbizlog.service;

import com.mzt.logapi.beans.LogRecord;
import com.mzt.logapi.service.ILogRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 日志数据处理方式
 * @author luHan
 * @create 2025/8/15 10:49
 * @since 1.0.0
 */
@Service
@Slf4j
public class DefaultLogRecordServiceImpl implements ILogRecordService {
    @Override
    public void record(LogRecord logRecord) {
        if (!logRecord.isFail()) {
            log.info("操作人:{} 操作详情:{}", logRecord.getOperator(), logRecord.getAction());
        } else {
            log.info("操作人:{} 发生异常:{}   异常数据:{}", logRecord.getOperator(), logRecord.getAction(), logRecord.getExtra());
        }
    }

    @Override
    public List<LogRecord> queryLog(String bizNo, String type) {
        return List.of();
    }

    @Override
    public List<LogRecord> queryLogByBizNo(String bizNo, String type, String subType) {
        return List.of();
    }
}
